﻿#ifndef RENDERMANAGER_H
#define RENDERMANAGER_H

#include "QtRender.h"

//渲染管理
class RenderManager: public QObject
{
    Q_OBJECT
public:
    static RenderManager* GetInstance();        //获取管理实列
    Render      *GetRender(RENDER_TYPE Type,int Width,int Height);   //获取对应渲染器
    ~RenderManager();

private:
    //构造函数，拷贝构造函数，赋值构造函数设置为private防止生成多个管理实列(单列模式需要)
    RenderManager(){}
    RenderManager(const RenderManager&) = delete;
    RenderManager& operator=(const RenderManager&) = delete;

private:
    static RenderManager* m_Instance;   //指向渲染管理实列
    static QMutex m_Mutex;              //锁
};

#endif // RENDERMANAGER_H
